18/03/24 PH
N2O with polarization dependence (this notebook).
N2O basic LF results: https://phockett.github.io/ePSdata/N2O-preliminary/N2O_orbs6-9_LF_preliminary_220224-tidy.html
TODO:
For methods: https://epsproc.readthedocs.io/en/dev/demos/ePSproc_class_demo_161020.html
# Quick hack to override default HTML template
# NOT required in some JLab versions.
# https://stackoverflow.com/a/63777508
# https://stackoverflow.com/questions/21971449/how-do-i-increase-the-cell-width-of-the-jupyter-ipython-notebook-in-my-browser
from IPython.core.display import display, HTML
display(HTML("<style>.container { width:100% !important; }</style>"))
import sys
import os
from pathlib import Path
import numpy as np
# import epsproc as ep
import xarray as xr
import matplotlib.pyplot as plt
from datetime import datetime as dt
timeString = dt.now()
import epsproc as ep
# Plotters
from epsproc.plot import hvPlotters
# Multijob class dev code
from epsproc.classes.multiJob import ePSmultiJob
hvPlotters.setPlotters(width = 700, snsStyle='whitegrid')
OMP: Info #276: omp_set_nested routine deprecated, please use omp_set_max_active_levels instead.
* sparse not found, sparse matrix forms not available. * natsort not found, some sorting functions not available.
* Setting plotter defaults with epsproc.basicPlotters.setPlotters(). Run directly to modify, or change options in local env.
* Set Holoviews with bokeh. * pyevtk not found, VTK export not available.
* Set Holoviews with bokeh.
import warnings
# warnings.filterwarnings('once') # Skip repeated numpy deprecation warnings in current build (xr15 env)
# warnings.filterwarnings('ignore') # Skip repeated numpy deprecation warnings in current build (xr15 env)
# # Scan for subdirs, based on existing routine in getFiles()
# fileBase = Path('/home/paul/ePS/OCS/OCS_survey') # Data dir on Stimpy
# fileBase = Path('/home/paul/fock-mount/globalhome/eps/N2O/N2O_valence') # Data dir on Jake (fock-mount)
# fileBase = Path('/home/paul/ePS/N2O/N2O_valence') # Data dir on Jake (local copy)
fileBase = Path('/home/jovyan/jake-home/ePS/N2O/N2O_valence') # Data dir on Jake (from ePSprc container)
# TODO: fix orb label here, currently relies on (different) fixed format
data = ePSmultiJob(fileBase, verbose = 0)
data.scanFiles()
data.jobsSummary()
*** Warning: Missing records, expected 32, found 24.
*** Warning: Found 8 blank sets of matrix elements, symmetries ['A2']
*** Warning: Missing records, expected 32, found 24.
*** Warning: Found 8 blank sets of matrix elements, symmetries ['A2']
*** Warning: Missing records, expected 32, found 24.
*** Warning: Found 8 blank sets of matrix elements, symmetries ['A2']
*** Warning: Missing records, expected 32, found 24.
*** Warning: Found 8 blank sets of matrix elements, symmetries ['A2']
*** Warning: Missing records, expected 32, found 24.
*** Warning: Found 8 blank sets of matrix elements, symmetries ['A2']
*** Warning: Missing records, expected 32, found 24.
*** Warning: Found 8 blank sets of matrix elements, symmetries ['A2']
*** Warning: Missing records, expected 32, found 24.
*** Warning: Found 8 blank sets of matrix elements, symmetries ['A2']
*** Warning: Missing records, expected 32, found 24.
*** Warning: Found 8 blank sets of matrix elements, symmetries ['A2']
Found 4 directories, with 16 files.
*** Job orb9_P details
Key: orb9_P
Dir /home/jovyan/jake-home/ePS/N2O/N2O_valence/orb9_P, 4 file(s).
{ 'batch': 'ePS N2O, batch N2O_valence, orbital orb9_P',
'event': 'orb 9 (P/CAv) ionization, batch N2O_valence, None.',
'orbE': -13.499568716634647,
'orbLabel': 'orb9_P',
'symmetryLabel': 'P/CAv'}
*** Job orb6_S details
Key: orb6_S
Dir /home/jovyan/jake-home/ePS/N2O/N2O_valence/orb6_S, 4 file(s).
{ 'batch': 'ePS N2O, batch N2O_valence, orbital orb6_S',
'event': 'orb 6 (S/CAv) ionization, batch N2O_valence, None.',
'orbE': -22.60177741591763,
'orbLabel': 'orb6_S',
'symmetryLabel': 'S/CAv'}
*** Job orb7_P details
Key: orb7_P
Dir /home/jovyan/jake-home/ePS/N2O/N2O_valence/orb7_P, 4 file(s).
{ 'batch': 'ePS N2O, batch N2O_valence, orbital orb7_P',
'event': 'orb 7 (P/CAv) ionization, batch N2O_valence, None.',
'orbE': -21.11331458826209,
'orbLabel': 'orb7_P',
'symmetryLabel': 'P/CAv'}
*** Job orb8_S details
Key: orb8_S
Dir /home/jovyan/jake-home/ePS/N2O/N2O_valence/orb8_S, 4 file(s).
{ 'batch': 'ePS N2O, batch N2O_valence, orbital orb8_S',
'event': 'orb 8 (S/CAv) ionization, batch N2O_valence, None.',
'orbE': -19.00715329282262,
'orbLabel': 'orb8_S',
'symmetryLabel': 'S/CAv'}
*** Job stacked details
Key: stacked
No 'job' info set for self.data[stacked].
Note orbital numbering in table below:
Orb is Gamess file output orbital numbering, but energy but not grouped by degeneracy.OrbGrp is grouped numbering by degeneracy, also used by ePolyScat, and will be used for labels etc. below.BUT - file names are 0-indexed (oops), so give OrbGrp-1 here. Sorry.
data.molSummary()
*** Molecular structure
*** Molecular orbital list (from ePS output file) EH = Energy (Hartrees), E = Energy (eV), NOrbGrp, OrbGrp, GrpDegen = degeneracies and corresponding orbital numbering by group in ePS, NormInt = single centre expansion convergence (should be ~1.0).
| props | Sym | SymOrb | EH | Occ | E | NOrbGrp | OrbGrp | GrpDegen | NormInt |
|---|---|---|---|---|---|---|---|---|---|
| orb | |||||||||
| 1 | S | 0.0 | -20.6612 | 2.0 | -562.219894 | 1.0 | 1.0 | 1.0 | 0.975090 |
| 2 | S | 0.0 | -15.8503 | 2.0 | -431.308635 | 1.0 | 2.0 | 1.0 | 0.975090 |
| 3 | S | 0.0 | -15.7018 | 2.0 | -427.267745 | 1.0 | 3.0 | 1.0 | 0.975090 |
| 4 | S | 0.0 | -1.6338 | 2.0 | -44.457963 | 1.0 | 4.0 | 1.0 | 0.975090 |
| 5 | S | 0.0 | -1.4519 | 2.0 | -39.508212 | 1.0 | 5.0 | 1.0 | 0.975090 |
| 6 | S | 0.0 | -0.8306 | 2.0 | -22.601777 | 1.0 | 6.0 | 1.0 | 0.975090 |
| 7 | P | 0.0 | -0.7759 | 2.0 | -21.113315 | 1.0 | 7.0 | 2.0 | 0.975090 |
| 8 | P | 0.0 | -0.7759 | 2.0 | -21.113315 | 2.0 | 7.0 | 2.0 | 0.999998 |
| 9 | S | 0.0 | -0.6985 | 2.0 | -19.007153 | 1.0 | 8.0 | 1.0 | 0.975090 |
| 10 | P | 0.0 | -0.4961 | 2.0 | -13.499569 | 1.0 | 9.0 | 2.0 | 0.975090 |
| 11 | P | 0.0 | -0.4961 | 2.0 | -13.499569 | 2.0 | 9.0 | 2.0 | 0.999998 |
*** Warning: some orbital convergences outside single-center expansion convergence tolerance (0.01): [[ 7. 2.] [ 8. 2.] [10. 2.] [11. 2.]]
Using EfiledPol class, set various ellipticities and fields $(E_x,E_y)$. For MF calcs, compute for all polarization geometries corresponding to fields aligned along $(x,y,z)$ molecular axes.
from epsproc.efield.epol import EfieldPol
import numpy as np
# Mulitple ellipticities and rotations
# For fields, set with format = [amplitude,azimuth (0,pi), ellipticity (-pi/4,pi/4)]
states = 10
# angles = np.linspace(0, np.pi, states) # For range of angles
angles = np.zeros(states) # no rotation
maxEll = 0.5 # Set max ellipticity to use (0 - 1)
ellipticities = np.linspace(0,maxEll*np.pi/4, states) # Set for 0 - max ellipticity
ell = np.c_[np.ones(states),angles,ellipticities]
labels = (ellipticities/(np.pi/4) * 100).round(2) # Set labels at %age ellipticity
# Set fields
Eell_multi = EfieldPol(ell=ell, labels = labels)
# Plot fields
Eell_multi.plot(figsize=(6,6), draw_arrow=False)
plt.legend(labels, loc='upper right')
Set field from ell. [[1. 0. 0. ] [1. 0. 0.04363323] [1. 0. 0.08726646] [1. 0. 0.13089969] [1. 0. 0.17453293] [1. 0. 0.21816616] [1. 0. 0.26179939] [1. 0. 0.30543262] [1. 0. 0.34906585] [1. 0. 0.39269908]]
<matplotlib.legend.Legend at 0x7fc8d30405e0>
# Compute MF results
data.MFBLM(EfieldPol = Eell_multi, thres = 1e-1)
Set parameters to `self.epDict` and `self.epXR`. Set pol state data to self.YLM and self.YLMrot, and orientations to self.RX. Set orientations to self.epDict['RX']. Set geomCalc.EPR() results to `self.EPRX`.
Note pol slider is ellipticity %age as set above (0 - 50%).
# Plot BLM parameters
# Note this may be quite slow for large results sets
data.BLMplot(dataType='MFBLM', thres = 1e-2, backend='hv', width=700, ylim=(-1.5, 2.5), xlim=(0,15))
BLMplot set data and plots to self.plots['BLMplot']